package com.Object.AllRoute;

import javax.microedition.khronos.opengles.GL10;
import com.Core.GameAnimation;
import com.Core.GameEngine;
import com.Object.ObjType;
import com.Object.SeaObject;

public class Shell extends SeaObject
{	private SeaObject holding;
	private float holdingScale;
	
	{	frameSlop	= GameAnimation.ShellSlop;
		texPos		= GameAnimation.ShellTexPos;
		setType(ObjType.Shell);
		
		holding		= new NullObject();
		holdingScale = 0.7f;
	}
	
	public void SwapHoldingObj()
	{	SeaObject obj=holding;
		holding=GameEngine.curObj;
		GameEngine.curObj=obj;
	}
	@Override
	public void DrawAtCell(GL10 gl, int row, int col)
	{	super.DrawAtCell(gl, row, col);
		if (holding.getType()!=ObjType.Null)
			holding.DrawAtPos(gl, row+1.0f-holdingScale/2, col+1.0f-holdingScale/2, holdingScale);
	}
}
